import http from "./axios";
export const getData = () => {
  return http.request({
    url: "/home/getData",
    method: "get",
  });
};
export const getUser = (params) => {
  return http.request({
    url: "/user/getUser",
    method: "get",
    params,
  });
};
export const addUser = (data) => {
  //新增用户Api
  return http.request({
    url: "/user/addUser",
    method: "post",
    data,
  });
};
export const editUser = (data) => {
  //修改用户Api
  return http.request({
    url: "/user/editUser",
    method: "post",
    data,
  });
};
export const delUser = (data) => {
  //删除用户Api
  return http.request({
    url: "/user/delUser",
    method: "post",
    data,
  });
};
export const getMenu = (data) => {
  return http.request({
    url: "/permission/getMenu",
    method: "post",
    data,
  });
};
export const login = (data) => {
  return http.request({
    url: "http://localhost:8091/api/user/login",
    method: "get",
    params: data,
  });
};
export const register = (data) => {
  return http.request({
    url: "http://localhost:8091/api/user/register",
    method: "post",
    data,
  });
};
// 商品列表
export const listProduct = (params) => {
  return http.request({
    url: "http://localhost:8091/api/products/list",
    method: "get",
    params,
  });
};
